﻿/**
 * Level.cs - A game level
 * 
 * Part of BoulderDAM - A BoulderDash clone using C# and SDL
 * Nacho Cabanes & students of DAM IES San Vicente, 2014
 * 
 * Revisions
 * #     Date         Creator, changes
 * ----  -----------  -------------------------------------------------------
 * 0.01  02-apr-2014  Nacho Cabanes: Basic skeleton
 */

namespace Boulder
{
    

    class Level
    {
        Map[] myMaps;
        const int NUM_MAPS = 2;
        int currentLevel = 0;
        // TO DO: A Level should contain several screens
    
        public Level()
        {
            myMaps = new Map[NUM_MAPS];
            /*for (int i=0; i<NUM_MAPS; i++)
                myMaps[i] = new Map();*/

            myMaps[0] = new Map01a();
            myMaps[1] = new Map01b();
        }


        public void DrawOnHiddenScreen()
        {
            myMaps[currentLevel].DrawOnHiddenScreen();
        }


        public bool CanMoveTo(int xStart, int yStart, int xEnd, int yEnd)
        {
            return myMaps[currentLevel].CanMoveTo(xStart, yStart, xEnd, yEnd);
        }


        public void AnimateElements()
        {
            myMaps[currentLevel].AnimateElements();
        }


        public void Advance()
        {
            currentLevel++;
            if (currentLevel >= NUM_MAPS)
                currentLevel = 0;
        }


        public void Reset()
        {
            // TO DO: Restore to starting conditions
        }
    }
}
